import Vue, { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
import store from './store/index'
// ant-design-vue
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css";
import * as AntIcon from '@ant-design/icons-vue'
import '@/assets/font_icon/iconfont.js'

// import './utils/particle'
//图片懒加载
import lazyPlugin from 'vue3-lazy'
import loadingImg from '@/assets/img/logo.png'
//md编辑器
import VMEditor from '@/plugin/v-md-editor' //VueMarkdownEditor
import VMdPreview from '@/plugin/v-md-preview' //VMdPreview

const app = createApp(App)
app.use(lazyPlugin, {
    loading: loadingImg, // 加载时默认图片
    error: loadingImg// 图片失败时默认图片
})
app.use(router).use(store).use(Antd).use(VMEditor).use(VMdPreview).mount('#app')

//全局公用组件注册
import codeblock from '@/components/code-block.vue' //引入公用组件 代码块高亮
app.component('codeblock',codeblock)

const antIcon:any = AntIcon
const Iconp = {...antIcon}
for(let i in Iconp){
    app.component(i,Iconp[i])
}

